package test06;

import java.util.Arrays; /**
 * 张量类
 */
public class Tensor {
    private float[] data;
    private int[] shape;

    public Tensor(float[] data, int[] shape) {
        this.data = data;
        this.shape = shape;
    }

    @Override
    public String toString() {
        return String.format("Tensor(shape=%s, data=%s)",
                Arrays.toString(shape), Arrays.toString(data));
    }

    // Getters
    public float[] getData() { return data; }
    public int[] getShape() { return shape; }
}
